package com.gph.saviorframework.os.authz.dao;

import com.gph.saviorframework.os.model.oauth.AccessToken;
import org.apache.ibatis.annotations.Param;
import org.aspectj.lang.annotation.Aspect;

import java.util.List;

@Aspect
public interface AccessTokenDao {

    void saveAccessToken(AccessToken accessToken);

    AccessToken findAccessToken(@Param("clientId") String clientId,
                                @Param("username") String username,
                                @Param("authenticationId") String authenticationId);

    AccessToken findAccessTokenByRefreshToken(@Param("refreshToken") String refreshToken,
                                              @Param("clientId") String clientId);

    void deleteAccessToken(AccessToken accessToken);

    List<AccessToken> findAccessTokenByTokenId(@Param("tokenId") String tokenId);
}
